import { injectable } from 'inversify';
import { EditorMode, IModeRegistry, ModeFeature } from '../types';

@injectable()
export class ModeRegistry implements IModeRegistry {
    private modes: Map<EditorMode, ModeFeature> = new Map();

    registerMode(mode: EditorMode, feature: ModeFeature): void {
        console.log('Registering mode:', mode, feature);
        this.modes.set(mode, feature);
    }

    unregisterMode(mode: EditorMode): void {
        this.modes.delete(mode);
    }

    getModeFeature(mode: EditorMode): ModeFeature | undefined {
        console.log('Getting mode feature for:', mode);
        console.log('Current modes:', Array.from(this.modes.keys()));
        return this.modes.get(mode);
    }

    getAvailableModes(): EditorMode[] {
        return Array.from(this.modes.keys());
    }
} 